Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMET-2759 OSBarcodeLib-Android - Implement torch button #6

Merged
merged 24 commits into from
Nov 16, 2023

Conversation

alexgerardojacinto
Copy link
Collaborator

@alexgerardojacinto alexgerardojacinto commented Nov 14, 2023

Description

  • This PR implements the flashlight button feature, adding the TorchButton function that contains a Button composable
    • The button already changes its state when turning the flashlight on and off.
  • It also includes the toggleFlashlight function that is used to turn the flashlight on and off.
  • The PR also includes the SVG files with the images used in the button (flash_on.xml and flash_off.xml).

Context

References: https://outsystemsrd.atlassian.net/browse/RMET-2759

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

Screenshots (if appropriate)

screen-20231114-202355.mp4

Checklist

  • Pull request title follows the format RNMT-XXXX <title>
  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

Context: The flashlight button should only be presented if the flashlight is available in the camera that is being used (front or back).

References: https://outsystemsrd.atlassian.net/browse/RMET-2759
Context: Our previous way of determining if the camera had a flashlight available was using the "isFlashAvailable" helper method. This method required a SuppressLint("RestrictedApi") annotation because of "selector.lensFacing". We should avoid using this specific annotation, and method "selector.lensFacing" isn't supposed to be used.

References: https://outsystemsrd.atlassian.net/browse/RMET-2759
@alexgerardojacinto alexgerardojacinto self-assigned this Nov 14, 2023
@alexgerardojacinto alexgerardojacinto changed the title Feat/rmet 2759/torch button RMET-2759 OSBarcodeLib-Android - Implement torch button Nov 14, 2023
@alexgerardojacinto alexgerardojacinto marked this pull request as ready for review November 14, 2023 19:03
Context: Since both catches do the exact same thing, we might as well only catch "Exception", that will include "CameraAccessException".

References: https://outsystemsrd.atlassian.net/browse/RMET-2759
Context: If "enableTorch" throws an exception, we don't want to alter the value of "isFlashlightOn" because we failed to alter the flashlight's state.

References: https://outsystemsrd.atlassian.net/browse/RMET-2759
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@alexgerardojacinto alexgerardojacinto merged commit 3a919c1 into development Nov 16, 2023
4 checks passed
@alexgerardojacinto alexgerardojacinto deleted the feat/RMET-2759/torch-button branch January 10, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants